<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		function exports(){
			var size = $("#contentTable tbody tr").length;
			if(size>0){
				$("#exports").submit();
			}else{
				showTip("导出失败！没有需要导出的用户信息数据","",3000,0);
			}
		}
		function resetFunc(){
			$("#searchForm input[type='text']").val("");
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/commonUser/">用户列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="yongUser" action="${ctx}/sys/commonUser/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li>
				<label style="width: 55px;">用户名：</label>
				<form:input path="loginName" htmlEscape="false" maxlength="50" class="input-small"/>
			</li>
			<li>
				<label style="width: 65px;">手机号码：</label>
				<form:input path="mobile" htmlEscape="false" maxlength="50" class="input-small"/>
			</li>
			<li>
				<label style="width: 65px;">注册时间：</label>
				<input name="startTime" type="text" placeholder="开始时间" readonly="readonly" class="input-medium Wdate " 
					value="<fmt:formatDate value="${user.startTime }" pattern="yyyy-MM-dd HH:mm:ss"/>"
			         onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
			     -
			     <input name="endTime" type="text" placeholder="结束时间" readonly="readonly" class="input-medium Wdate " 
					value="<fmt:formatDate  value="${user.endTime }" pattern="yyyy-MM-dd HH:mm:ss"/>"
			     onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> 
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/></li>
			<li class="btns"><input class="btn btn-primary" type="button" value="重置" onclick="resetFunc()"/></li>
			<li class="btns"><input class="btn btn-primary" type="button" value="导出" onclick="exports()"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<form:form id="exports" modelAttribute="yongUser" action="${ctx}/sys/commonUser/export" method="post" >
		<input type="hidden" name="loginName" value="${user.loginName }"/>
		<input type="hidden" name="mobile" value="${user.mobile }"/>
		<input type="hidden" name="startTime" value="${user.startTime }"/>
		<input type="hidden" name="endTime" value="${user.endTime }"/>
	</form:form>
	<div style="display:none;">
		<sys:message content="${message}"/>
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>用户名</th>
				<th>手机号码</th>
				<th>电子邮箱</th>
				<th>注册时间</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="user" varStatus="index">
			<tr>
				<td>${index.index+1 }</td>
				<td><a href="${ctx}/sys/commonUser/commonUserDetail?id=${user.id}"></a>${user.loginName}</td>
				<td>${user.mobile }</td>
				<td>${user.email }</td>
				<td><fmt:formatDate value="${user.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>